home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / plotting / pcgplots / gptdisp.h < prev    next >
C/C++ Source or Header  |  1992-04-24  |  4KB  |  126 lines

  1. // C++ .h file for pc gplot display classes
  2. // copyright 1992 Pittsburgh Supercomputing Center
  3. #ifndef _gptdisp
  4. #define _gptdisp
  5. #include "cgmdisp.h" // basic display classes
  6. #include "cgm.h" // basic Gplot
  7. #include <windows.h>
  8. enum patType { solid,dash, dot, dash_dot, dash_dot_dot};
  9.  
  10. // forward refs
  11. class Window;
  12. class Scroller;
  13. class FrameWindow;
  14. class FileObject;
  15. class cgmFile;
  16. class cgmObject;
  17. class cgmMetafile;
  18. class    cgmPicture;
  19. //class cgmWindow;
  20. //typedefs
  21.  
  22. //typedef cgmWindow   * CgmWindowPt;
  23. typedef cgmObject   * CgmObjectPt;
  24. typedef cgmFile     * CgmFilePt;
  25. typedef cgmPicture  * CgmPicturePt;
  26. typedef cgmMetafile * CgmMetafilePt;
  27. // *** class pcDisplay
  28.  
  29. class pcDisplay : public baseDisplay {
  30. private:
  31.   int noElements;  // # of elements drawn
  32.   RECT itsExtent;
  33.   RECT clipr;
  34.   vdcPts *myPxlExtent;
  35.   float myxPxlSize, myyPxlSize;
  36.   COLORREF RGBbackground;
  37.   int line_pnsize;
  38.   int now_pnsize;
  39.   BOOL UseLinePen;    // false if polyline pen setup for text, marker
  40.   BOOL edgeseen;
  41.   BOOL useclip;  // if clip rectangle exists, use it
  42.   BOOL solidpoly;
  43.   BOOL hollowpoly;
  44.   BOOL Index1Set;
  45.   HDC hdc;          // device context
  46.   HDC hdcMeta;      // Metafile context
  47.   LOGPEN lEdgePen;
  48.   LOGPEN lLinePen;
  49.   LOGPEN lTextPen;
  50.   LOGPEN lMarkerPen;
  51.   LOGBRUSH lFillBrush;
  52.   HPEN   hEdgePen;
  53.   HPEN   hLinePen;
  54.   HPEN   hTextPen;
  55.   HPEN   hMarkerPen;
  56.   HPEN   hHollowPen;
  57.   HPEN   hPenUsed;
  58.   HBRUSH hFillBrush;
  59.   HBRUSH hBackgroundBrush;
  60.   HBRUSH hBrushUsed;
  61.   HANDLE hPenOrig;
  62.   HANDLE hBrushOrig;
  63.   BOOL LinePenOK;
  64.   BOOL EdgePenOK;
  65.   BOOL TextPenOK;
  66.   BOOL MarkerPenOK;
  67.   BOOL FillBrushOK;
  68.   CgmWindowPt cgmWin;
  69.   int myBackIndex;
  70. public:
  71.   pcDisplay(CgmWindowPt win,HDC hdc, HDC hdcMeta, HDC hdcInfo, RECT *rect); // constructor
  72.   ~pcDisplay(); // destructor
  73.  
  74.   virtual void setExtent(RECT *inExtent) {itsExtent = *inExtent;}
  75.   virtual void getExtent(RECT *outExtent) { *outExtent =  itsExtent;    }
  76.   COLORREF getback() const {return RGBbackground;}
  77.   LOGPALETTE *MakeDefaultPalette(void);
  78.   virtual int getLineType(void) { return myLineType;}
  79.   virtual const vdcR *getlineWidth(void){ return myLineWidth ;}
  80.   virtual int getEdgeType(void) { return myEdgeType;}
  81.   virtual const vdcR *getEdgeWidth(void){ return myEdgeWidth ;}
  82.   virtual void backColr(const genColr&);
  83.   void backColr2();
  84.   void adjustPens();
  85.   virtual int cells(const cellArray*); // overide baseDisplay function
  86.  
  87.   virtual int polyline(const vdcPts*); // display a polyline
  88.   virtual int polygon(const vdcPts* ); // display a filled polyline
  89.   virtual inline int invert() { return 1;} // do we need inversion ? - yes
  90.   virtual void lineColr(const genColr &inColr );
  91.   virtual void fillColr(const genColr &);
  92.   virtual void edgeColr(const genColr &);
  93.   virtual void textColr(const genColr &inColr);
  94.   virtual int text(const genText *); // default function
  95.   virtual void markerColr(const genColr &inColr);
  96.   virtual int polymarker(const vdcPts *); // default function
  97.  
  98.   virtual void colrs(const colrTable *);  // set Mac palette to match color table
  99.   virtual inline vdcPts *pxlExtent() {return myPxlExtent;}
  100.   //virtual inline vdcPts *mmExtent() {return myMmExtent;}
  101.   virtual float xPxlSize()          {return myxPxlSize;} // x pixel size in mm (required)
  102.   virtual float yPxlSize()          {return myyPxlSize;} // y pixel size in mm (required)
  103.   virtual void lineType(int inType); // overide {myLineType = inType;}
  104.   virtual void lineWidth(const vdcR *inWidth); // overide {myLineWidth = inWidth;}
  105.   virtual void edgeType(int inType); // overide {myEdgeType = inType;}
  106.   virtual void edgeWidth(const vdcR *inWidth); // overide {myEdgeWidth = inWidth;}
  107.   void SetLinePen();
  108.   void SetEdgePen();
  109.   void SetTextPen();
  110.   void SetMarkerPen();
  111.   void SetHollowPen(COLORREF);
  112.   void SetBackBrush(COLORREF);
  113.   void SetFillBrush();
  114.   void ExtentRect();
  115.   virtual void intStyle(int inStyle);
  116.   virtual void edgeVis(int inVis);
  117.   int width() {return myPxlExtent->i(2);  } // width of screen
  118.   int height() {return myPxlExtent->i(3); } // height of screen
  119.  
  120.   // contol elements
  121.   virtual void clipRect(const vdcPts *inPts);
  122.   virtual void clip(int inClip);
  123.  
  124. };
  125. #endif // __pcDisp_
  126.